Skip to content

fix: apply monorepo root react-doctor config to workspace package scans#103

Open
sonwr wants to merge 1 commit intomillionco:mainfrom
sonwr:fix/monorepo-root-config-fallback
Open

fix: apply monorepo root react-doctor config to workspace package scans#103
sonwr wants to merge 1 commit intomillionco:mainfrom
sonwr:fix/monorepo-root-config-fallback

Conversation

@sonwr
Copy link

@sonwr sonwr commented Mar 10, 2026

This fixes #73.

Summary:

  • fall back to the monorepo root react-doctor.config.json / package.json#reactDoctor when scanning a workspace package that does not have its own local config
  • keep package-local config higher priority than the monorepo root fallback

Why:

  • the CLI selects workspace packages from the repo root, but each scan runs from the package directory
  • previously loadConfig() only checked the package directory itself, so root-level config was ignored for workspace package scans

Changes:

  • extracted per-directory config loading into a helper
  • updated loadConfig() to:
    • return local config first
    • otherwise detect the monorepo root and load config from there as a fallback
  • added tests covering:
    • monorepo root fallback
    • local package config precedence over root config

Validation:

  • pnpm build
  • pnpm exec vitest run tests/load-config.test.ts --reporter=dot
  • manual CLI repro with a temporary monorepo confirmed that a root-level ignore rule now applies to a workspace package scan

@vercel
Copy link

vercel bot commented Mar 10, 2026

@sonwr is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@MontaEllis8 MontaEllis8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Code Review 通过

代码审查通过,建议合并。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monorepo Issues

2 participants